QT       += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17

win32{
	message ($$QMAKE_COMPILER)
	equals(QMAKE_COMPILER, msvc) {
		message (" VS Complier, UTF-8 switch is on.")
		QMAKE_CXXFLAGS += -utf-8
		QMAKE_CFLAGS += -utf-8
	}
	INCLUDEPATH+=$$PWD/npcap/Include
	contains(QT_ARCH, i386) {
	LIBS+=-L"$$PWD/npcap/lib" -lwpcap
	} else {
	LIBS+=-L"$$PWD/npcap/lib/x64" -lwpcap
	}
}else: LIBS+=-lpcap

#Qt6 Widgets static link in MSYS2 need extra dependencies.
contains(QT, widgets){
MSYSTEM_PREFIX=$$(MSYSTEM_PREFIX)
greaterThan(MSYSTEM_PREFIX,' '){
contains(CONFIG, static) {
	message ("Perform Qt6 Static library with MSYS2 patch.")
	CONFIG += no_lflags_merge
	#LIBS += -ltiff  -lmng -ljpeg -ljbig -ldeflate  -lzstd -llerc -llzma  -lgraphite2 -lbz2 -lusp10 -lRpcrt4 -lsharpyuv -lOleAut32
}
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_LFLAGS_RELEASE -= -O1
QMAKE_LFLAGS_RELEASE += -O3
}
}

SOURCES += \
	io/cap_thread.cpp \
	io/pcapio.cpp \
	io/sslserver.cpp \
	io/tcptunnel.cpp \
	main.cpp \
	dlgpcaphub.cpp \
	tb_interface/listen_thread.cpp

HEADERS += \
	dlgpcaphub.h \
	io/cap_thread.h \
	io/pcapio.h \
	io/sslserver.h \
	io/tcptunnel.h \
	tb_interface/cmdlineparser.h \
	tb_interface/listen_thread.h \
	tb_interface/tb_interface.h

FORMS += \
	dlgpcaphub.ui

TRANSLATIONS += \
	pcapHub_zh_CN.ts
CONFIG += lrelease
CONFIG += embed_translations

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
	resource.qrc

RC_ICONS += app.ico
